package com.lzx.article.controller.web;

import com.lzx.article.service.UserRecommendService;
import com.lzx.common.utils.R;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * @author 程序员星星
 * @date 2023/2/5
 * @Description
 */
@RestController
@RequestMapping("/article/userRecommend/web")
public class WebUserRecommendController {
    @Resource
    private UserRecommendService userRecommendService;

    //文章详情页面中文章推荐
    @GetMapping("/articleDetailsRecommend/{articleId}")
    public R articleDetailsRecommend(@PathVariable Long articleId) {
        return userRecommendService.articleDetailsRecommend(articleId);
    }

    //用户文章推荐
    @GetMapping("/userArticleRecommend")
    public R userArticleRecommend(@RequestParam(required = false) Long userId) {
        return userRecommendService.userArticleRecommend(userId);
    }
}
